package com.xq.pojo;

import com.xq.annotation.Extract;
import com.xq.annotation.JsoupDocument;

/**
 * 文章实体类
 */
@JsoupDocument(
         domain = "https://zhipeng0908.gitee.io/page/2/page/6/"
        ,targetUrl = "https://zhipeng0908.gitee.io/page/6/"
        ,cssQuery = ".post-block")
public class Article {

    @Extract(cssQuery = ".post-block .post-title-link")
    private String title;

    @Extract(cssQuery = ".post-block .post-category  span:nth-child(4)")
    private String type;

    @Extract(cssQuery = ".post-block .post-title-link",attr = "href")
    private String url;

    @Extract(cssQuery = ".post-block .post-body  p")
    private String comment;

    @JsoupDocument( domain = "https://zhipeng0908.gitee.io/", hrefAttr = "url")
    private ArticleContent articleContent;


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public ArticleContent getArticleContent() {
        return articleContent;
    }

    public void setArticleContent(ArticleContent articleContent) {
        this.articleContent = articleContent;
    }

    @Override
    public String toString() {
        return "Article{" +
                "title='" + title + '\'' +
                ", type='" + type + '\'' +
                ", url='" + url + '\'' +
                ", comment='" + comment + '\'' +
                ", articleContent=" + articleContent +
                '}';
    }
}